from django.db import models


class Blog(models.Model):
    title = models.CharField(max_length=32)
    date = models.DateTimeField(auto_now_add=True)
    text = models.TextField()
	
class Catergorie(models.Model):
	type=models.CharField(max_length=32)
	date=models.DateTimeField(auto_now_add=True)
	
	def __unicode__(self):
		return self.type
	
class Post(models.Model):
	title = models.CharField(max_length=32)
	date = models.DateTimeField(auto_now_add=True)
	desc = models.TextField()
	catergories_id = models.ForeignKey(Catergorie)
	def __unicode__(self):
		return self.title

class Website(models.Model) :
	Website = models.URLField()
	def __unicode__(self):
		return self.Website

class Setting(models.Model) :
    Turn_off = models.BooleanField()
    custom_message = models.CharField(max_length=200, default = "Sorry we're updating the blog please come back later")
    def __unicode__(self):
		return self.custom_message
	
class Page(models.Model) :
    Header= models.CharField(max_length=32)
    desc= models.TextField()
    def __unicode__(self):
		return self.Header
    
	
